<?php
if(!interface_exists('XClassFactory', false)){
	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'XClassFactory.php');
}
if(!class_exists('XAnnotationClassFactory', false)){
	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'XAnnotationClassFactory.php');
}
final class XFactory implements XClassFactory{
	private static $instance = null;
	
	private function __construct() {
	
	}
	
	/** 
	 * @return XFactory
	 */	
	static function singleton() {
		if (!self::$instance) {
			self::$instance = new self;
		}
		return self::$instance;
	}
	
	public function get($class, $scope = null, $args = array()){
		return XAnnotationClassFactory::singleton()->get($class, $scope, $args);
	}
	
	public function invokeArgs($object, $method, $args = array()){
		return XAnnotationClassFactory::singleton()->invokeArgs($object, $method, $args);
	}
}
?>